/*
 * Copyright (c) 2020-2024 Huawei Cloud Computing Technology Co., Ltd. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this list of
 *    conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
 *    of conditions and the following disclaimer in the documentation and/or other materials
 *    provided with the distribution.
 *
 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
 *    to endorse or promote products derived from this software without specific prior written
 *    permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */


#include "bmsinfo.h"
#include "common.h"
#include "calculate.h"

/**
 * @brief 
 * 
 */
static _SystemDataStru sysDataStru;

const St_ListIotKey m_ListKey[SIZE_LISTKEY] =
{
#if 0
    {"sw_version",                  TYPE_STR,	UINT32_DATA,	(void *)&sysDataStru.SysParamStru.SwVer },			
    {"hw_version",                  TYPE_STR,	UINT32_DATA,	(void *)&sysDataStru.SysParamStru.HwVer },
    {"ch2_vol",                     TYPE_VALUE,	UINT16_DATA,	(void *)&sysDataStru.ch2_vol },
    {"VcellMax",                    TYPE_VALUE,	UINT16_DATA,	(void *)&sysDataStru.VcellMax },
    {"VcellMaxID",                  TYPE_VALUE,	U8_I8_DATA,	    (void *)&sysDataStru.VcellMaxID.allbits },
    {"VcellMin",                    TYPE_VALUE,	UINT16_DATA,	(void *)&sysDataStru.VcellMin },
    {"VcellMinID",                  TYPE_VALUE,	U8_I8_DATA,	    (void *)&sysDataStru.VcellMinID.allbits },
    {"Tmax",                        TYPE_VALUE,	FLOAT_DATA,	    (void *)&sysDataStru.Tmax },
    {"Tmax_ID",                     TYPE_VALUE,	U8_I8_DATA,	    (void *)&sysDataStru.Tmax_ID.allbits },
    {"Tmin",                        TYPE_VALUE,	FLOAT_DATA,	    (void *)&sysDataStru.Tmin },
    {"Tmin_ID",                     TYPE_VALUE,	U8_I8_DATA,	    (void *)&sysDataStru.Tmin_ID.allbits },

    {"envTempe",                    TYPE_VALUE, FLOAT_DATA,     (void *)&sysDataStru.env_temperature },
    {"envHumidity",                 TYPE_VALUE, FLOAT_DATA,     (void *)&sysDataStru.env_humidity },
    
    {"battery_total_vol",           TYPE_VALUE,	UINT16_DATA,	(void *)&sysDataStru.battery_total_vol },
    {"I_system",                    TYPE_VALUE,	UINT16_DATA,	(void *)&sysDataStru.I_system },
    {"R_iso",                       TYPE_VALUE,	UINT16_DATA,	(void *)&sysDataStru.R_iso },
    {"soc",                         TYPE_VALUE,	FLOAT_DATA,	    (void *)&sysDataStru.SOC },
    {"Switch1",                     TYPE_VALUE,	UINT16_DATA,	(void *)&sysDataStru.hi_switch_state.Switch1 },
    {"Switch2",                     TYPE_VALUE,	UINT16_DATA,	(void *)&sysDataStru.hi_switch_state.Switch2 },
    {"Switch3",                     TYPE_VALUE,	UINT16_DATA,	(void *)&sysDataStru.hi_switch_state.Switch3 },
    {"Switch4",                     TYPE_VALUE,	UINT16_DATA,	(void *)&sysDataStru.hi_switch_state.Switch4 },
    {"Switch5",                     TYPE_VALUE,	UINT16_DATA,	(void *)&sysDataStru.hi_switch_state.Switch5 },
    {"Switch6",                     TYPE_VALUE,	UINT16_DATA,	(void *)&sysDataStru.hi_switch_state.Switch6 },

    {"chg_total_capacity",          TYPE_VALUE,	UINT32_DATA,	(void *)&sysDataStru.cal.chg_total_capacity },
    {"charge_capacity",             TYPE_VALUE,	UINT32_DATA,	(void *)&sysDataStru.cal.charge_capacity },
    {"discharge_capacity",          TYPE_VALUE,	UINT32_DATA,	(void *)&sysDataStru.cal.discharge_capacity },
    {"chg_wh",                      TYPE_VALUE,	UINT32_DATA,	(void *)&sysDataStru.cal.chg_wh },
    {"dsg_wh",                      TYPE_VALUE,	UINT32_DATA,	(void *)&sysDataStru.cal.dsg_wh},

    // 告警
    {"pack_ov",                     TYPE_VALUE,	UINT8_DATA,	(void *)&sysDataStru.sysAlarmStru.pack_ov },
    {"pack_uv",                     TYPE_VALUE,	UINT8_DATA,	(void *)&sysDataStru.sysAlarmStru.pack_uv },
    {"cell_ov",                     TYPE_VALUE,	UINT8_DATA,	(void *)&sysDataStru.sysAlarmStru.cell_ov },
    {"cell_uv",                     TYPE_VALUE,	UINT8_DATA,	(void *)&sysDataStru.sysAlarmStru.cell_uv },
    {"delta_v",                     TYPE_VALUE,	UINT8_DATA,	(void *)&sysDataStru.sysAlarmStru.delta_v },
    {"delta_t",                     TYPE_VALUE,	UINT8_DATA,	(void *)&sysDataStru.sysAlarmStru.delta_t },
    {"chg_over_T",                  TYPE_VALUE,	UINT8_DATA,	(void *)&sysDataStru.sysAlarmStru.chg_over_T },
    {"dsg_over_T",                  TYPE_VALUE,	UINT8_DATA,	(void *)&sysDataStru.sysAlarmStru.dsg_over_T },
    {"chg_over_current",            TYPE_VALUE,	UINT8_DATA,	(void *)&sysDataStru.sysAlarmStru.chg_over_current },
    {"dsg_over_current",            TYPE_VALUE,	UINT8_DATA,	(void *)&sysDataStru.sysAlarmStru.dsg_over_current },
    {"dsg_ut",                      TYPE_VALUE,	UINT8_DATA,	(void *)&sysDataStru.sysAlarmStru.dsg_ut },
    {"balance_t",                   TYPE_VALUE,	UINT8_DATA,	(void *)&sysDataStru.sysAlarmStru.balance_t },
    {"balance_err",                 TYPE_VALUE,	UINT8_DATA,	(void *)&sysDataStru.sysAlarmStru.balance_err },
    {"afe_error",                   TYPE_VALUE,	UINT8_DATA,	(void *)&sysDataStru.sysAlarmStru.afe_error },
    {"low_soc",                     TYPE_VALUE,	UINT8_DATA,	(void *)&sysDataStru.sysAlarmStru.low_soc },
    {"insulation_r",                TYPE_VALUE,	UINT8_DATA,	(void *)&sysDataStru.sysAlarmStru.insulation_r },
    
    // 配置项
    {"chgPackVolOpenTHD",           TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.chgPackVolOpenTHD },
    {"chgPackVolWarningTHD",        TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.chgPackVolWarningTHD },
    {"dsgPackVolOpenTHD",           TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.dsgPackVolOpenTHD },
    {"dsgPackVolWarningTHD",        TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.dsgPackVolWarningTHD },
    {"Ip_ChgOpenTHD",               TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.Ip_ChgOpenTHD },
    {"IpChgWarningTHD",             TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.IpChgWarningTHD },
    {"Ip_DsgOpenTHD",               TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.Ip_DsgOpenTHD },
    {"Ip_DsgWarningTHD",            TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.Ip_DsgWarningTHD },
    {"ChgOTOpenTHD",                TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.ChgOTOpenTHD },
    {"ChgOTWarningTHD",             TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.ChgOTWarningTHD },
    {"DsgOTOpenTHD",                TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.DsgOTOpenTHD },
    {"DsgOTWarningTHD",             TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.DsgOTWarningTHD },
    {"DsgUTOpenTHD",                TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.DsgUTOpenTHD },
    {"DsgUTWarningTHD",             TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.DsgUTWarningTHD },
    {"deltaT_OpenTHD",              TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.deltaT_OpenTHD },
    {"deltaT_WarningTHD",           TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.deltaT_WarningTHD },
    {"deltaVolOpenTHD",             TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.deltaVolOpenTHD },
    {"deltaVolWarningTHD",          TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.deltaVolWarningTHD },
    {"SOC_L3THD",                   TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.SOC_L3THD },
    {"SOC_L2THD",                   TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.SOC_L2THD },
    {"SOC_L1THD",                   TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.SOC_L1THD },
    {"origi_SOH",                   TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.origi_SOH },
    {"RatedKWh",                    TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.RatedKWh },
    {"Rated_Capacity",              TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.Rated_Capacity },
    {"shunt_I",                     TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.shunt_I },
    {"shunt_mV",                    TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.shunt_mV },
    {"chg_start_dec_curret_of_vol",	TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.chg_start_dec_curret_of_vol },
    {"cellOverVolOpenTHD",			TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.cellOverVolOpenTHD },
    {"cellOverVolWaringTHD",        TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.cellOverVolWaringTHD },
    {"cellUnderVolOpenTHD",         TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.cellUnderVolOpenTHD },
    {"cellUnderVolWarningTHD",      TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.cellUnderVolWarningTHD },
    {"chg_ut_l1",                   TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.chg_ut_l1 },
    {"chg_ut_l2",                   TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.chg_ut_l2 },
    {"VdiffStatic_StartBal",        TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.VdiffStatic_StartBal },
    {"VdiffStatic_StopBal",         TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.VdiffStatic_StopBal },
    {"iso_r_OpenThd",               TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.iso_r_OpenThd },
    {"iso_r_WarningThd",            TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.iso_r_WarningThd },
    {"chg_current_finish_thd",      TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.chg_current_finish_thd },
    {"precharge_ratio",             TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.precharge_ratio },
    {"Rated_chg_pack_vol",          TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.Rated_chg_pack_vol },
    {"Rated_chg_current",           TYPE_VALUE,		UINT16_DATA,	(void *)&sysDataStru.SysParamStru.Rated_chg_current },

    // 单体电压
    {"CellVolt1_1",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[0].voltage[0].Bit.VcellVal },
    {"CellVolt1_2",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[0].voltage[1].Bit.VcellVal },
    {"CellVolt1_3",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[0].voltage[2].Bit.VcellVal },
    {"CellVolt1_4",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[0].voltage[3].Bit.VcellVal },
    {"CellVolt1_5",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[0].voltage[4].Bit.VcellVal },
    {"CellVolt1_6",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[0].voltage[5].Bit.VcellVal },
    {"CellVolt1_7",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[0].voltage[6].Bit.VcellVal },
    {"CellVolt1_8",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[0].voltage[7].Bit.VcellVal },
    {"CellVolt1_9",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[0].voltage[8].Bit.VcellVal },
    {"CellVolt1_10",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[0].voltage[9].Bit.VcellVal },
    {"CellVolt1_11",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[0].voltage[10].Bit.VcellVal },
    {"CellVolt1_12",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[0].voltage[11].Bit.VcellVal },
    {"CellVolt1_13",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[0].voltage[12].Bit.VcellVal },
    {"CellVolt1_14",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[0].voltage[13].Bit.VcellVal },
    {"CellVolt1_15",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[0].voltage[14].Bit.VcellVal },
    {"CellVolt1_16",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[0].voltage[15].Bit.VcellVal },
    {"CellVolt1_17",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[0].voltage[16].Bit.VcellVal },
    {"CellVolt1_18",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[0].voltage[17].Bit.VcellVal },
    {"CellVolt2_1",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[1].voltage[0].Bit.VcellVal  },
    {"CellVolt2_2",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[1].voltage[1].Bit.VcellVal  },
    {"CellVolt2_3",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[1].voltage[2].Bit.VcellVal  },
    {"CellVolt2_4",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[1].voltage[3].Bit.VcellVal  },
    {"CellVolt2_5",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[1].voltage[4].Bit.VcellVal  },
    {"CellVolt2_6",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[1].voltage[5].Bit.VcellVal  },
    {"CellVolt2_7",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[1].voltage[6].Bit.VcellVal  },
    {"CellVolt2_8",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[1].voltage[7].Bit.VcellVal  },
    {"CellVolt2_9",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[1].voltage[8].Bit.VcellVal  },
    {"CellVolt2_10",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[1].voltage[9].Bit.VcellVal  },
    {"CellVolt2_11",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[1].voltage[10].Bit.VcellVal },
    {"CellVolt2_12",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[1].voltage[11].Bit.VcellVal },
    {"CellVolt2_13",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[1].voltage[12].Bit.VcellVal },
    {"CellVolt2_14",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[1].voltage[13].Bit.VcellVal },
    {"CellVolt2_15",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[1].voltage[14].Bit.VcellVal },
    {"CellVolt2_16",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[1].voltage[15].Bit.VcellVal },
    {"CellVolt2_17",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[1].voltage[16].Bit.VcellVal },
    {"CellVolt2_18",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[1].voltage[17].Bit.VcellVal },
    {"CellVolt3_1",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[2].voltage[0].Bit.VcellVal  },
    {"CellVolt3_2",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[2].voltage[1].Bit.VcellVal  },
    {"CellVolt3_3",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[2].voltage[2].Bit.VcellVal  },
    {"CellVolt3_4",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[2].voltage[3].Bit.VcellVal  },
    {"CellVolt3_5",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[2].voltage[4].Bit.VcellVal  },
    {"CellVolt3_6",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[2].voltage[5].Bit.VcellVal  },
    {"CellVolt3_7",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[2].voltage[6].Bit.VcellVal  },
    {"CellVolt3_8",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[2].voltage[7].Bit.VcellVal  },
    {"CellVolt3_9",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[2].voltage[8].Bit.VcellVal  },
    {"CellVolt3_10",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[2].voltage[9].Bit.VcellVal  },
    {"CellVolt3_11",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[2].voltage[10].Bit.VcellVal },
    {"CellVolt3_12",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[2].voltage[11].Bit.VcellVal },
    {"CellVolt3_13",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[2].voltage[12].Bit.VcellVal },
    {"CellVolt3_14",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[2].voltage[13].Bit.VcellVal },
    {"CellVolt3_15",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[2].voltage[14].Bit.VcellVal },
    {"CellVolt3_16",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[2].voltage[15].Bit.VcellVal },
    {"CellVolt3_17",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[2].voltage[16].Bit.VcellVal },
    {"CellVolt3_18",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[2].voltage[17].Bit.VcellVal },
    {"CellVolt4_1",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[3].voltage[0].Bit.VcellVal  },
    {"CellVolt4_2",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[3].voltage[1].Bit.VcellVal  },
    {"CellVolt4_3",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[3].voltage[2].Bit.VcellVal  },
    {"CellVolt4_4",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[3].voltage[3].Bit.VcellVal  },
    {"CellVolt4_5",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[3].voltage[4].Bit.VcellVal  },
    {"CellVolt4_6",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[3].voltage[5].Bit.VcellVal  },
    {"CellVolt4_7",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[3].voltage[6].Bit.VcellVal  },
    {"CellVolt4_8",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[3].voltage[7].Bit.VcellVal  },
    {"CellVolt4_9",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[3].voltage[8].Bit.VcellVal  },
    {"CellVolt4_10",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[3].voltage[9].Bit.VcellVal  },
    {"CellVolt4_11",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[3].voltage[10].Bit.VcellVal },
    {"CellVolt4_12",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[3].voltage[11].Bit.VcellVal },
    {"CellVolt4_13",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[3].voltage[12].Bit.VcellVal },
    {"CellVolt4_14",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[3].voltage[13].Bit.VcellVal },
    {"CellVolt4_15",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[3].voltage[14].Bit.VcellVal },
    {"CellVolt4_16",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[3].voltage[15].Bit.VcellVal },
    {"CellVolt4_17",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[3].voltage[16].Bit.VcellVal },
    {"CellVolt4_18",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[3].voltage[17].Bit.VcellVal },
    {"CellVolt5_1",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[4].voltage[0].Bit.VcellVal  },
    {"CellVolt5_2",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[4].voltage[1].Bit.VcellVal  },
    {"CellVolt5_3",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[4].voltage[2].Bit.VcellVal  },
    {"CellVolt5_4",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[4].voltage[3].Bit.VcellVal  },
    {"CellVolt5_5",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[4].voltage[4].Bit.VcellVal  },
    {"CellVolt5_6",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[4].voltage[5].Bit.VcellVal  },
    {"CellVolt5_7",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[4].voltage[6].Bit.VcellVal  },
    {"CellVolt5_8",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[4].voltage[7].Bit.VcellVal  },
    {"CellVolt5_9",                 TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[4].voltage[8].Bit.VcellVal  },
    {"CellVolt5_10",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[4].voltage[9].Bit.VcellVal  },
    {"CellVolt5_11",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[4].voltage[10].Bit.VcellVal },
    {"CellVolt5_12",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[4].voltage[11].Bit.VcellVal },
    {"CellVolt5_13",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[4].voltage[12].Bit.VcellVal },
    {"CellVolt5_14",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[4].voltage[13].Bit.VcellVal },
    {"CellVolt5_15",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[4].voltage[14].Bit.VcellVal },
    {"CellVolt5_16",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[4].voltage[15].Bit.VcellVal },
    {"CellVolt5_17",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[4].voltage[16].Bit.VcellVal },
    {"CellVolt5_18",                TYPE_VALUE,   UINT16_DATA,	(void *)&sysDataStru.bmu[4].voltage[17].Bit.VcellVal },

    // 单体温度
    {"CellTempe1_1",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[0].temprature[0] },
    {"CellTempe1_2",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[0].temprature[1] },
    {"CellTempe1_3",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[0].temprature[2] },
    {"CellTempe1_4",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[0].temprature[3] },
    {"CellTempe2_1",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[1].temprature[0] },
    {"CellTempe2_2",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[1].temprature[1] },
    {"CellTempe2_3",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[1].temprature[2] },
    {"CellTempe2_4",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[1].temprature[3] },
    {"CellTempe3_1",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[2].temprature[0] },
    {"CellTempe3_2",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[2].temprature[1] },
    {"CellTempe3_3",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[2].temprature[2] },
    {"CellTempe3_4",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[2].temprature[3] },
    {"CellTempe4_1",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[3].temprature[0] },
    {"CellTempe4_2",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[3].temprature[1] },
    {"CellTempe4_3",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[3].temprature[2] },
    {"CellTempe4_4",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[3].temprature[3] },
    {"CellTempe5_1",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[4].temprature[0] },
    {"CellTempe5_2",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[4].temprature[1] },
    {"CellTempe5_3",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[4].temprature[2] },
    {"CellTempe5_4",                TYPE_VALUE,   FLOAT_DATA,	(void *)&sysDataStru.bmu[4].temprature[3] },

    {NULL,      TYPE_VALUE,     UINT16_DATA,    (void*)NULL },

    #endif

#if 1
    {"sw_version",                  TYPE_STR,   UINT32_DATA,    (void *)&sysDataStru.SysParamStru.SwVer },
    {"hw_version",                  TYPE_STR,   UINT32_DATA,    (void *)&sysDataStru.SysParamStru.HwVer },
    {"ch2_vol",                     TYPE_VALUE, UINT16_DATA,    (void *)&sysDataStru.ch2_vol },
    {"VcellMax",                    TYPE_VALUE, UINT16_DATA,    (void *)&sysDataStru.VcellMax },
    {"VcellMaxID",                  TYPE_VALUE, U8_I8_DATA,     (void *)&sysDataStru.VcellMaxID.allbits },
    {"VcellMin",                    TYPE_VALUE, UINT16_DATA,    (void *)&sysDataStru.VcellMin },
    {"VcellMinID",                  TYPE_VALUE, U8_I8_DATA,     (void *)&sysDataStru.VcellMinID.allbits },
    {"Tmax",                        TYPE_VALUE, FLOAT_DATA,     (void *)&sysDataStru.Tmax },
    {"Tmax_ID",                     TYPE_VALUE, U8_I8_DATA,     (void *)&sysDataStru.Tmax_ID.allbits },
    {"Tmin",                        TYPE_VALUE, FLOAT_DATA,     (void *)&sysDataStru.Tmin },
    {"Tmin_ID",                     TYPE_VALUE, U8_I8_DATA,     (void *)&sysDataStru.Tmin_ID.allbits },

    {"envTempe",                    TYPE_VALUE, FLOAT_DATA,     (void *)&sysDataStru.env_temperature },
    {"envHumidity",                 TYPE_VALUE, FLOAT_DATA,     (void *)&sysDataStru.env_humidity },
    {"envMQ2",                      TYPE_VALUE, UINT16_DATA,    (void *)&sysDataStru.env_mq2 },

//    {"battery_total_vol",           TYPE_VALUE, UINT16_DATA,    (void *)&sysDataStru.battery_total_vol },
//    {"I_system",                    TYPE_VALUE, UINT16_DATA,    (void *)&sysDataStru.I_system },
//    {"R_iso",                       TYPE_VALUE, UINT16_DATA,    (void *)&sysDataStru.R_iso },
    {"soc",                         TYPE_VALUE, FLOAT_DATA,     (void *)&sysDataStru.SOC },
    {"Switch1",                     TYPE_VALUE, UINT16_DATA,    (void *)&sysDataStru.hi_switch_state.Switch1 },
    {"Switch2",                     TYPE_VALUE, UINT16_DATA,    (void *)&sysDataStru.hi_switch_state.Switch2 },
    {"Switch3",                     TYPE_VALUE, UINT16_DATA,    (void *)&sysDataStru.hi_switch_state.Switch3 },
    {"Switch4",                     TYPE_VALUE, UINT16_DATA,    (void *)&sysDataStru.hi_switch_state.Switch4 },
    {"Switch5",                     TYPE_VALUE, UINT16_DATA,    (void *)&sysDataStru.hi_switch_state.Switch5 },
    {"Switch6",                     TYPE_VALUE, UINT16_DATA,    (void *)&sysDataStru.hi_switch_state.Switch6 },

//    {"chg_total_capacity",          TYPE_VALUE, UINT32_DATA,    (void *)&sysDataStru.cal.chg_total_capacity },
//    {"charge_capacity",             TYPE_VALUE, UINT32_DATA,    (void *)&sysDataStru.cal.charge_capacity },
//    {"discharge_capacity",          TYPE_VALUE, UINT32_DATA,    (void *)&sysDataStru.cal.discharge_capacity },
//    {"chg_wh",                      TYPE_VALUE, UINT32_DATA,    (void *)&sysDataStru.cal.chg_wh },
//    {"dsg_wh",                      TYPE_VALUE, UINT32_DATA,    (void *)&sysDataStru.cal.dsg_wh},

    // 告警
//    {"pack_ov",                     TYPE_VALUE, UINT8_DATA, (void *)&sysDataStru.sysAlarmStru.pack_ov },
//    {"pack_uv",                     TYPE_VALUE, UINT8_DATA, (void *)&sysDataStru.sysAlarmStru.pack_uv },
//    {"cell_ov",                     TYPE_VALUE, UINT8_DATA, (void *)&sysDataStru.sysAlarmStru.cell_ov },
//    {"cell_uv",                     TYPE_VALUE, UINT8_DATA, (void *)&sysDataStru.sysAlarmStru.cell_uv },
    {"delta_v",                     TYPE_VALUE, UINT8_DATA, (void *)&sysDataStru.sysAlarmStru.delta_v },
//    {"delta_t",                     TYPE_VALUE, UINT8_DATA, (void *)&sysDataStru.sysAlarmStru.delta_t },
//    {"chg_over_T",                  TYPE_VALUE, UINT8_DATA, (void *)&sysDataStru.sysAlarmStru.chg_over_T },
//    {"dsg_over_T",                  TYPE_VALUE, UINT8_DATA, (void *)&sysDataStru.sysAlarmStru.dsg_over_T },
//    {"chg_over_current",            TYPE_VALUE, UINT8_DATA, (void *)&sysDataStru.sysAlarmStru.chg_over_current },
//    {"dsg_over_current",            TYPE_VALUE, UINT8_DATA, (void *)&sysDataStru.sysAlarmStru.dsg_over_current },
//    {"dsg_ut",                      TYPE_VALUE, UINT8_DATA, (void *)&sysDataStru.sysAlarmStru.dsg_ut },
//    {"balance_t",                   TYPE_VALUE, UINT8_DATA, (void *)&sysDataStru.sysAlarmStru.balance_t },
//    {"balance_err",                 TYPE_VALUE, UINT8_DATA, (void *)&sysDataStru.sysAlarmStru.balance_err },
//    {"afe_error",                   TYPE_VALUE, UINT8_DATA, (void *)&sysDataStru.sysAlarmStru.afe_error },
    {"low_soc",                     TYPE_VALUE, UINT8_DATA, (void *)&sysDataStru.sysAlarmStru.low_soc },
//    {"insulation_r",                TYPE_VALUE, UINT8_DATA, (void *)&sysDataStru.sysAlarmStru.insulation_r },
#endif

#if 0
    // 配置项
    {"chgPackVolOpenTHD",           TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.chgPackVolOpenTHD },
    {"chgPackVolWarningTHD",        TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.chgPackVolWarningTHD },
    {"dsgPackVolOpenTHD",           TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.dsgPackVolOpenTHD },
    {"dsgPackVolWarningTHD",        TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.dsgPackVolWarningTHD },
    {"Ip_ChgOpenTHD",               TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.Ip_ChgOpenTHD },
    {"IpChgWarningTHD",             TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.IpChgWarningTHD },
    {"Ip_DsgOpenTHD",               TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.Ip_DsgOpenTHD },
    {"Ip_DsgWarningTHD",            TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.Ip_DsgWarningTHD },
    {"ChgOTOpenTHD",                TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.ChgOTOpenTHD },
    {"ChgOTWarningTHD",             TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.ChgOTWarningTHD },
    {"DsgOTOpenTHD",                TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.DsgOTOpenTHD },
    {"DsgOTWarningTHD",             TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.DsgOTWarningTHD },
    {"DsgUTOpenTHD",                TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.DsgUTOpenTHD },
    {"DsgUTWarningTHD",             TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.DsgUTWarningTHD },
    {"deltaT_OpenTHD",              TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.deltaT_OpenTHD },
    {"deltaT_WarningTHD",           TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.deltaT_WarningTHD },
    {"deltaVolOpenTHD",             TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.deltaVolOpenTHD },
    {"deltaVolWarningTHD",          TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.deltaVolWarningTHD },
    {"SOC_L3THD",                   TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.SOC_L3THD },
    {"SOC_L2THD",                   TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.SOC_L2THD },
    {"SOC_L1THD",                   TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.SOC_L1THD },
    {"origi_SOH",                   TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.origi_SOH },
    {"RatedKWh",                    TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.RatedKWh },
    {"Rated_Capacity",              TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.Rated_Capacity },
    {"shunt_I",                     TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.shunt_I },
    {"shunt_mV",                    TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.shunt_mV },
    {"chg_start_dec_curret_of_vol", TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.chg_start_dec_curret_of_vol },
    {"cellOverVolOpenTHD",          TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.cellOverVolOpenTHD },
    {"cellOverVolWaringTHD",        TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.cellOverVolWaringTHD },
    {"cellUnderVolOpenTHD",         TYPE_VALUE,     UINT16_hDATA,    (void *)&sysDataStru.SysParamStru.cellUnderVolOpenTHD },
    {"cellUnderVolWarningTHD",      TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.cellUnderVolWarningTHD },
    {"chg_ut_l1",                   TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.chg_ut_l1 },
    {"chg_ut_l2",                   TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.chg_ut_l2 },
    {"VdiffStatic_StartBal",        TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.VdiffStatic_StartBal },
    {"VdiffStatic_StopBal",         TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.VdiffStatic_StopBal },
    {"iso_r_OpenThd",               TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.iso_r_OpenThd },
    {"iso_r_WarningThd",            TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.iso_r_WarningThd },
    {"chg_current_finish_thd",      TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.chg_current_finish_thd },
    {"precharge_ratio",             TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.precharge_ratio },
    {"Rated_chg_pack_vol",          TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.Rated_chg_pack_vol },
    {"Rated_chg_current",           TYPE_VALUE,     UINT16_DATA,    (void *)&sysDataStru.SysParamStru.Rated_chg_current },
#endif

#if 1
    // 单体电压
    {"CellVolt1_1",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[0].voltage[0].Bit.VcellVal },
    {"CellVolt1_2",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[0].voltage[1].Bit.VcellVal },
    {"CellVolt1_3",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[0].voltage[2].Bit.VcellVal },
    {"CellVolt1_4",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[0].voltage[3].Bit.VcellVal },
    {"CellVolt1_5",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[0].voltage[4].Bit.VcellVal },
    {"CellVolt1_6",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[0].voltage[5].Bit.VcellVal },
    {"CellVolt1_7",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[0].voltage[6].Bit.VcellVal },
    {"CellVolt1_8",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[0].voltage[7].Bit.VcellVal },
//    {"CellVolt1_9",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[0].voltage[8].Bit.VcellVal },
//    {"CellVolt1_10",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[0].voltage[9].Bit.VcellVal },
//    {"CellVolt1_11",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[0].voltage[10].Bit.VcellVal },
//    {"CellVolt1_12",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[0].voltage[11].Bit.VcellVal },
//    {"CellVolt1_13",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[0].voltage[12].Bit.VcellVal },
//    {"CellVolt1_14",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[0].voltage[13].Bit.VcellVal },
//    {"CellVolt1_15",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[0].voltage[14].Bit.VcellVal },
//    {"CellVolt1_16",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[0].voltage[15].Bit.VcellVal },
//    {"CellVolt1_17",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[0].voltage[16].Bit.VcellVal },
//    {"CellVolt1_18",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[0].voltage[17].Bit.VcellVal },
//    {"CellVolt2_1",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[1].voltage[0].Bit.VcellVal  },
//    {"CellVolt2_2",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[1].voltage[1].Bit.VcellVal  },
//    {"CellVolt2_3",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[1].voltage[2].Bit.VcellVal  },
//    {"CellVolt2_4",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[1].voltage[3].Bit.VcellVal  },
//    {"CellVolt2_5",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[1].voltage[4].Bit.VcellVal  },
//    {"CellVolt2_6",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[1].voltage[5].Bit.VcellVal  },
//    {"CellVolt2_7",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[1].voltage[6].Bit.VcellVal  },
//    {"CellVolt2_8",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[1].voltage[7].Bit.VcellVal  },
//    {"CellVolt2_9",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[1].voltage[8].Bit.VcellVal  },
//    {"CellVolt2_10",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[1].voltage[9].Bit.VcellVal  },
//    {"CellVolt2_11",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[1].voltage[10].Bit.VcellVal },
//    {"CellVolt2_12",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[1].voltage[11].Bit.VcellVal },
//    {"CellVolt2_13",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[1].voltage[12].Bit.VcellVal },
//    {"CellVolt2_14",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[1].voltage[13].Bit.VcellVal },
//    {"CellVolt2_15",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[1].voltage[14].Bit.VcellVal },
//    {"CellVolt2_16",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[1].voltage[15].Bit.VcellVal },
//    {"CellVolt2_17",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[1].voltage[16].Bit.VcellVal },
//    {"CellVolt2_18",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[1].voltage[17].Bit.VcellVal },
//    {"CellVolt3_1",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[2].voltage[0].Bit.VcellVal  },
//    {"CellVolt3_2",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[2].voltage[1].Bit.VcellVal  },
//    {"CellVolt3_3",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[2].voltage[2].Bit.VcellVal  },
//    {"CellVolt3_4",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[2].voltage[3].Bit.VcellVal  },
//    {"CellVolt3_5",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[2].voltage[4].Bit.VcellVal  },
//    {"CellVolt3_6",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[2].voltage[5].Bit.VcellVal  },
//    {"CellVolt3_7",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[2].voltage[6].Bit.VcellVal  },
//    {"CellVolt3_8",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[2].voltage[7].Bit.VcellVal  },
//    {"CellVolt3_9",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[2].voltage[8].Bit.VcellVal  },
//    {"CellVolt3_10",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[2].voltage[9].Bit.VcellVal  },
//    {"CellVolt3_11",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[2].voltage[10].Bit.VcellVal },
//    {"CellVolt3_12",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[2].voltage[11].Bit.VcellVal },
//    {"CellVolt3_13",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[2].voltage[12].Bit.VcellVal },
//    {"CellVolt3_14",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[2].voltage[13].Bit.VcellVal },
//    {"CellVolt3_15",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[2].voltage[14].Bit.VcellVal },
//    {"CellVolt3_16",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[2].voltage[15].Bit.VcellVal },
//    {"CellVolt3_17",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[2].voltage[16].Bit.VcellVal },
//    {"CellVolt3_18",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[2].voltage[17].Bit.VcellVal },
//    {"CellVolt4_1",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[3].voltage[0].Bit.VcellVal  },
//    {"CellVolt4_2",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[3].voltage[1].Bit.VcellVal  },
//    {"CellVolt4_3",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[3].voltage[2].Bit.VcellVal  },
//    {"CellVolt4_4",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[3].voltage[3].Bit.VcellVal  },
//    {"CellVolt4_5",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[3].voltage[4].Bit.VcellVal  },
//    {"CellVolt4_6",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[3].voltage[5].Bit.VcellVal  },
//    {"CellVolt4_7",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[3].voltage[6].Bit.VcellVal  },
//    {"CellVolt4_8",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[3].voltage[7].Bit.VcellVal  },
//    {"CellVolt4_9",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[3].voltage[8].Bit.VcellVal  },
//    {"CellVolt4_10",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[3].voltage[9].Bit.VcellVal  },
//    {"CellVolt4_11",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[3].voltage[10].Bit.VcellVal },
//    {"CellVolt4_12",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[3].voltage[11].Bit.VcellVal },
//    {"CellVolt4_13",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[3].voltage[12].Bit.VcellVal },
//    {"CellVolt4_14",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[3].voltage[13].Bit.VcellVal },
//    {"CellVolt4_15",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[3].voltage[14].Bit.VcellVal },
//    {"CellVolt4_16",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[3].voltage[15].Bit.VcellVal },
//    {"CellVolt4_17",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[3].voltage[16].Bit.VcellVal },
//    {"CellVolt4_18",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[3].voltage[17].Bit.VcellVal },
//    {"CellVolt5_1",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[4].voltage[0].Bit.VcellVal  },
//    {"CellVolt5_2",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[4].voltage[1].Bit.VcellVal  },
//    {"CellVolt5_3",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[4].voltage[2].Bit.VcellVal  },
//    {"CellVolt5_4",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[4].voltage[3].Bit.VcellVal  },
//    {"CellVolt5_5",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[4].voltage[4].Bit.VcellVal  },
//    {"CellVolt5_6",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[4].voltage[5].Bit.VcellVal  },
//    {"CellVolt5_7",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[4].voltage[6].Bit.VcellVal  },
//    {"CellVolt5_8",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[4].voltage[7].Bit.VcellVal  },
//    {"CellVolt5_9",                 TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[4].voltage[8].Bit.VcellVal  },
//    {"CellVolt5_10",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[4].voltage[9].Bit.VcellVal  },
//    {"CellVolt5_11",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[4].voltage[10].Bit.VcellVal },
//    {"CellVolt5_12",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[4].voltage[11].Bit.VcellVal },
//    {"CellVolt5_13",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[4].voltage[12].Bit.VcellVal },
//    {"CellVolt5_14",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[4].voltage[13].Bit.VcellVal },
//    {"CellVolt5_15",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[4].voltage[14].Bit.VcellVal },
//    {"CellVolt5_16",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[4].voltage[15].Bit.VcellVal },
//    {"CellVolt5_17",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[4].voltage[16].Bit.VcellVal },
//    {"CellVolt5_18",                TYPE_VALUE,   UINT16_DATA,  (void *)&sysDataStru.bmu[4].voltage[17].Bit.VcellVal },

    // 单体温度
    {"CellTempe1_1",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[0].temprature[0] },
    {"CellTempe1_2",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[0].temprature[1] },
    {"CellTempe1_3",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[0].temprature[2] },
    {"CellTempe1_4",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[0].temprature[3] },
//    {"CellTempe2_1",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[1].temprature[0] },
//    {"CellTempe2_2",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[1].temprature[1] },
//    {"CellTempe2_3",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[1].temprature[2] },
//    {"CellTempe2_4",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[1].temprature[3] },
//    {"CellTempe3_1",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[2].temprature[0] },
//    {"CellTempe3_2",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[2].temprature[1] },
//    {"CellTempe3_3",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[2].temprature[2] },
//    {"CellTempe3_4",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[2].temprature[3] },
//    {"CellTempe4_1",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[3].temprature[0] },
//    {"CellTempe4_2",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[3].temprature[1] },
//    {"CellTempe4_3",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[3].temprature[2] },
//    {"CellTempe4_4",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[3].temprature[3] },
//    {"CellTempe5_1",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[4].temprature[0] },
//    {"CellTempe5_2",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[4].temprature[1] },
//    {"CellTempe5_3",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[4].temprature[2] },
//    {"CellTempe5_4",                TYPE_VALUE,   FLOAT_DATA,   (void *)&sysDataStru.bmu[4].temprature[3] },
#endif
};

/**
 * @brief 
 * 
 * @return St_ListIotKey* 
 */
St_ListIotKey* getmListKey(void)
{
    return (m_ListKey);
}

size_t getSizeOfListKey(void)
{
    return sizeof(m_ListKey) / sizeof(m_ListKey[0]);
}

/**
 * @brief Get the Bms Inf object
 * 
 * @return _SystemDataStru* 
 */
_SystemDataStru *getBmsInf(void)
{
    return (&sysDataStru);
}

/**
 * @brief 
 * 
 */
void afe_CalcAdjustData(void)
{
    uint16_t i, board_index;
    uint16_t temp;

    _SystemDataStru *bmsInf = getBmsInf();

    for (board_index = 0; board_index < BMU_OF_NUM; board_index ++) /*电压配置*/
    {
        if (board_index < MAX_LTC6813_CHIP_NUM) /*默认使能5个板*/
        {
            bmsInf->bmu[board_index].vol_valid.ALL = VOL_VALID_DEFAULT;
        }
        else
        {
            bmsInf->bmu[board_index].vol_valid.ALL = 0;
        }
    }

    for (board_index = 0; board_index < BMU_OF_NUM; board_index++) /*更新电压有效*/
    {
        for (i = 0; i < CELL_NUM_PER_UINT; i++)
        {
            temp = ((bmsInf->bmu[board_index].vol_valid.ALL >> i) & 0x01) > 0 ? 1 : 0;
            bmsInf->bmu[board_index].voltage[i].Bit.valid = temp;
        }
    }

    // 温度有效值
    for (board_index = 0; board_index < BMU_OF_NUM; board_index++)
    {
        for (i = 0; i < TEMP_NUM_PER_UINT; i++)
        {
            if (board_index < MAX_LTC6813_CHIP_NUM)/*默认使能5个板*/
            {
                bmsInf->bmu[board_index].tempratureCaliVal[i].Bit.valid = 1;
            }
            else
            {
                bmsInf->bmu[board_index].tempratureCaliVal[i].Bit.valid = 0;
            }
            bmsInf->bmu[board_index].tempratureCaliVal[i].Bit.TempVal = CAL_T_OFFSET;
        }
    }
}

/**
 * @brief 
 * 
 */
void init_BmsInfoCellVolt(void)
{
    uint16_t i = 0, board_index;
    _SystemDataStru *bmsInf = getBmsInf();

    for (board_index = 0; board_index < BMU_OF_NUM; board_index++)
    {
        for (i = 0; i < CELL_NUM_PER_UINT; i ++)
        {
            bmsInf->bmu[board_index].voltage[i].Bit.VcellVal = 3700;
        }
    }
}

/**
 * @brief 
 * 
 */
void init_BmsInfoCellTempe(void)
{
    uint16_t i = 0, board_index;
    _SystemDataStru *bmsInf = getBmsInf();

    for (board_index = 0; board_index < BMU_OF_NUM; board_index++) // 点位 600 - 620
    {
        for (i = 0; i < TEMP_NUM_PER_UINT; i ++)
        {
            bmsInf->bmu[board_index].temprature[i] = 23.6f;
        }
    }
}

/**
 * @brief 
 * 
 */
void BmsInfoInit(void)
{
    _SystemDataStru *bmsInf = getBmsInf();

    bmsInf->SysParamStru.HwVer                      = 2024121201u;
    bmsInf->SysParamStru.SwVer                      = SOFTWARE_VERSION;
    bmsInf->SysParamStru.BatType                    = 0x0;

    bmsInf->SysParamStru.deltaT_OpenTHD             = DELTA_T_THD_DEFAULT;                  /* 单体温度1级 */
    bmsInf->SysParamStru.deltaT_WarningTHD          = DELTA_T_WARNING_THD_DEFAULT;          /* 单体温度2级 */
    bmsInf->SysParamStru.deltaVolOpenTHD            = DELTA_VOL_OPEN_THD_DEFAULT;           /* 单体压差1级 */
    bmsInf->SysParamStru.deltaVolWarningTHD         = DELTA_VOL_WARNING_THD_DEFAULT;        /* 单体压差2级 */
    // bmsInf->SysParamStru.VcellLo_LimitDChgTHD       = V_CELL_2LO_LMT_DCHG_THD;              /* 单体过低限制放电门限 */
    bmsInf->SysParamStru.cellOverVolOpenTHD         = CELL_OVER_VOL_THD_DEFAULT;            /* 单体过压保护门限  */
    bmsInf->SysParamStru.cellOverVolWaringTHD       = CELL_OV_WARNING_THD_DEFAULT;          /* 单体过压保护门限 */
    bmsInf->SysParamStru.cellUnderVolOpenTHD        = CELL_UV_OPEN_DEFAULT;                 /* 单体欠压压保护门限   */
    bmsInf->SysParamStru.cellUnderVolWarningTHD     = CELL_UV_WARNING_THD_DEFAULT;          /* 单体欠压压保护门限  */
    bmsInf->SysParamStru.VdiffStatic_StartBal       = V_CELL_DELTA_THD_START;               /* 静态单体极差开启门限 */
    bmsInf->SysParamStru.VdiffStatic_StopBal        = V_CELL_DELTA_THD_STOP;                /* 静态单体极差开启门限 */
    bmsInf->SysParamStru.banlanceSwitch             = BALANCE_SWITCH_EN_DEFAULT;            /* 均衡使能开关 */

    bmsInf->SysParamStru.chgPackVolOpenTHD          = BATT_Open_POV;
    bmsInf->SysParamStru.chgPackVolWarningTHD       = BATT_WARN_POV;
    bmsInf->SysParamStru.dsgPackVolOpenTHD          = BATT_DSG_PACK_OPEN_UV;
    bmsInf->SysParamStru.dsgPackVolWarningTHD       = BATT_DSG_PACK_WARNING_UV;
    bmsInf->SysParamStru.Ip_ChgOpenTHD              = BATT_CHG_OPEN_I;
    bmsInf->SysParamStru.IpChgWarningTHD            = BATT_CHG_WARNING_I;
    bmsInf->SysParamStru.Ip_DsgOpenTHD              = BATT_DSG_OPEN_I;
    bmsInf->SysParamStru.Ip_DsgWarningTHD           = BATT_DSG_WARNING_I;
    bmsInf->SysParamStru.ChgOTOpenTHD               = CHG_OT_OPEN_THD;
    bmsInf->SysParamStru.ChgOTWarningTHD            = CHG_OT_WARNING_THD_DEFAULT;
    bmsInf->SysParamStru.DsgOTOpenTHD               = DSG_OT_OPEN_THD;
    bmsInf->SysParamStru.DsgOTWarningTHD            = DSG_OT_WARNING_THD_DEFAULT;
    bmsInf->SysParamStru.DsgUTOpenTHD               = DSG_UT_TEMP_THD;
    bmsInf->SysParamStru.DsgUTWarningTHD            = DSG_UT_WARNING_THD_DEFAULT;
    bmsInf->SysParamStru.SOC_L3THD                  = BATT_ALARM3_SOC;
    bmsInf->SysParamStru.SOC_L2THD                  = BATT_ALARM2_SOC;
    bmsInf->SysParamStru.SOC_L1THD                  = BATT_ALARM1_SOC;
    bmsInf->SysParamStru.origi_SOH                  = 100;
    bmsInf->SysParamStru.RatedKWh                   = BATT_RATED_01KWH;
    bmsInf->SysParamStru.Rated_Capacity             = BATT_RATED_AH;
    bmsInf->SysParamStru.shunt_I                    = BIU_SHUNT_TYPE_I_DEFAULT;
    bmsInf->SysParamStru.shunt_mV                   = BIU_SHUNT_TYPE_V_DEFAULT;
    bmsInf->SysParamStru.chg_start_dec_curret_of_vol = CELL_CHG_THD_DEFAULT;
    bmsInf->SysParamStru.chg_ut_l1                  = CHG_UT_TEMP_THD;
    bmsInf->SysParamStru.chg_ut_l2                  = CHG_UT_WARNING_THD_DEFAULT;
    bmsInf->SysParamStru.iso_r_OpenThd              = ALARM1_ISO_R_DEFAULT;
    bmsInf->SysParamStru.iso_r_WarningThd           = ALARM2_ISO_R_DEFAULT;
    bmsInf->SysParamStru.chg_current_finish_thd     = CHG_FINISH_CURRENT_THD_DEFAULT;
    bmsInf->SysParamStru.precharge_ratio            = PRECHARGE_RATIO_DEFAULT;
    bmsInf->SysParamStru.Rated_chg_pack_vol         = RATE_CHG_VOL_THD_DEFAULT;
    bmsInf->SysParamStru.Rated_chg_current          = RATE_CHG_CURRENT_THD_DEFAULT;

}

/**
 * @brief 
 * 
 */
void show_DispDateTime(void)
{
    char *format = NULL;
    format = PrependLocalTimeWithMs(NULL);

    DebugInfo("\r[long]  : %s\n", format);
	MemFree(&format);
}

/**
 * @brief 
 * 
 */
void init_BmsInfoDefault(void)
{
    BmsInfoInit();

    afe_CalcAdjustData();

    init_BmsInfoCellVolt();

    init_BmsInfoCellTempe();
}

/**
 * @brief 
 * 
 * @param args 
 * @return void* 
 */
void Update_BmsInfo_Thread(void *args)
{
    // static uint32_t cnt = 0;

    _SystemDataStru *bmsInf = getBmsInf();
    
    while(1)
    {
        // cnt = (++ cnt) % 1000;
        // int randNumber = rand()%100;
        // DebugInfo("\r randNumber = %d\n", randNumber);
        // DebugInfo("\r[long] Update_BmsInfo_Thread cnt -> %d\n", cnt);

        modify_BmsInfoCellVolt();
        modify_BmsInfoCellTempe();

        maxMinCellVol();
        maxMinTemp();    
        calculate_soc();
        checkAlarmTask();
    
        osDelay(200); 
    }
}



void updateBmsInfo_TaskEntry(void)
{
    osThreadAttr_t attr = {0};
    attr.name = "updateBmsTask";
    attr.stack_size = 1024 * 2;
    attr.priority = osPriorityNormal;
    
    if (osThreadNew(Update_BmsInfo_Thread, NULL, &attr) == NULL)
    {
        osal_printk("[Error] Falied to create updateBmsTask ...\n");
    }
}


